package com.example.threadtest.entity;

import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;
import java.io.Serializable;

/**
 * (User)实体类
 *
 * @author 越
 * @since 2021-03-24 18:04:39
 */
@Data
@ToString
public class User implements Serializable {
    private static final long serialVersionUID = -17017349180406343L;
    /**
    * 索引
    */
    private Integer index;
    /**
    * id
    */
    private Integer id;
    /**
    * 账号
    */
    @NotBlank(message = "用户名不能为空")
    private String username;
    /**
    * 密码
    */
    @NotBlank(message = "密码不能为空")
    private String password;
    /**
    * 昵称
    */
    @NotBlank(message = "昵称不能为空")
    private String name;
    /**
    * 性别
    */
    @NotBlank(message = "性别不能为空")
    private String sex;
    /**
    * 手机号码
    */
    @NotBlank(message = "手机号码不能为空")
    @Pattern(regexp = "^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\\d{8}$",message = "填写的手机号格式有误")
    private String phone;
    /**
    * 注册时间
    */
    private Date registerTime;
    /**
    * 是否冻结
    */
    private String isFrozen;
}